﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;

namespace MyBlog.Model.Entity
{
    /// <summary>
    /// 博客类
    /// </summary>
    public class Blog
    {
        [SugarColumn(IsPrimaryKey = true)]
        public string Id { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        [Required, MaxLength(100)]
        public string Title { get; set; }

        /// <summary>
        /// 类型(CSharp、Java）
        /// </summary>
        public int BlogTypeId { get; set; }


        /// <summary>
        /// 创建时间
        /// </summary>
        [Column(TypeName = "date")]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        [Column(TypeName = "date")]
        public DateTime UpdateTime { get; set; }

        /// <summary>
        /// 博客内容
        /// </summary>
        public string? Content { get; set; }

        /// <summary>
        /// 简介
        /// </summary>
        [MaxLength(200)]
        public string? Introduction { get; set; }

        /// <summary>
        /// 浏览量
        /// </summary>
        public int Views { get; set; }
        /// <summary>
        /// 博客封面
        /// </summary>
        public string Photo { get; set; }
    }
}
